<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>查找匹配的文件路径模式</title>
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-base.css" />
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-medium.css" />

 </head>
 <body class="docs"><div class="navbar navbar-fixed-top">
  <div class="navbar-inner clearfix">
    <ul class="nav" style="width: 100%">
      <li style="float: left;"><a href="wrappers.data.html">« data://</a></li>
      <li style="float: right;"><a href="wrappers.phar.html">phar:// »</a></li>
    </ul>
  </div>
</div>
<div id="breadcrumbs" class="clearfix">
  <ul class="breadcrumbs-container">
    <li><a href="index.html">PHP Manual</a></li>
    <li><a href="wrappers.html">支持的协议和封装协议</a></li>
    <li>查找匹配的文件路径模式</li>
  </ul>
</div>
<div id="layout">
  <div id="layout-content"><div id="wrappers.glob" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">glob://</h1>
  <p class="refpurpose"><span class="refname">glob://</span> &mdash; <span class="dc-title">查找匹配的文件路径模式</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-wrappers.glob-description">
  <h3 class="title">说明</h3>
  <p class="simpara">
   
   <var class="filename">glob:</var> 数据流包装器。
  </p>
 </div>


 <div class="refsect1 usage" id="refsect1-wrappers.glob-usage"> 
  <h3 class="title">用法</h3>
  <ul class="itemizedlist">
   <li class="listitem"><span class="simpara"><var class="filename">glob://</var></span></li>
  </ul>
 </div>
 

 <div class="refsect1 options" id="refsect1-wrappers.glob-options">
  <h3 class="title">可选项</h3>
  <p class="para">
   <table class="doctable table">
    <caption><strong>封装协议摘要</strong></caption>
    
     <thead>
      <tr>
       <th>属性</th>
       <th>支持</th>
      </tr>

     </thead>

     <tbody class="tbody">
      <tr>
       <td>受限于 <a href="filesystem.configuration.html#ini.allow-url-fopen" class="link">allow_url_fopen</a></td>
       <td>No</td>
      </tr>

      <tr>
       <td>受限于 <a href="filesystem.configuration.html#ini.allow-url-include" class="link">allow_url_include</a></td>
       <td>No</td>
      </tr>

      <tr>
       <td>允许读取</td>
       <td>No</td>
      </tr>

      <tr>
       <td>允许写入</td>
       <td>No</td>
      </tr>

      <tr>
       <td>允许附加</td>
       <td>No</td>
      </tr>

      <tr>
       <td>允许同时读写</td>
       <td>No</td>
      </tr>

      <tr>
       <td>支持 <span class="function"><a href="function.stat.html" class="function">stat()</a></span></td>
       <td>No</td>
      </tr>

      <tr>
       <td>支持 <span class="function"><a href="function.unlink.html" class="function">unlink()</a></span></td>
       <td>No</td>
      </tr>

      <tr>
       <td>支持 <span class="function"><a href="function.rename.html" class="function">rename()</a></span></td>
       <td>No</td>
      </tr>

      <tr>
       <td>支持 <span class="function"><a href="function.mkdir.html" class="function">mkdir()</a></span></td>
       <td>No</td>
      </tr>

      <tr>
       <td>支持 <span class="function"><a href="function.rmdir.html" class="function">rmdir()</a></span></td>
       <td>No</td>
      </tr>

     </tbody>
    
   </table>

  </p>
 </div>
 

 <div class="refsect1 examples" id="refsect1-wrappers.glob-examples">
  <h3 class="title">范例</h3>
  <div class="example" id="example-424">
   <p><strong>示例 #1 基本用法</strong></p>
   <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br /></span><span style="color: #FF8000">//&nbsp;循环&nbsp;ext/spl/examples/&nbsp;目录里所有&nbsp;*.php&nbsp;文件<br />//&nbsp;并打印文件名和文件尺寸<br /></span><span style="color: #0000BB">$it&nbsp;</span><span style="color: #007700">=&nbsp;new&nbsp;</span><span style="color: #0000BB">DirectoryIterator</span><span style="color: #007700">(</span><span style="color: #DD0000">"glob://ext/spl/examples/*.php"</span><span style="color: #007700">);<br />foreach(</span><span style="color: #0000BB">$it&nbsp;</span><span style="color: #007700">as&nbsp;</span><span style="color: #0000BB">$f</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">printf</span><span style="color: #007700">(</span><span style="color: #DD0000">"%s:&nbsp;%.1FK\n"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$f</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getFilename</span><span style="color: #007700">(),&nbsp;</span><span style="color: #0000BB">$f</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getSize</span><span style="color: #007700">()/</span><span style="color: #0000BB">1024</span><span style="color: #007700">);<br />}<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
   </div>

   <div class="example-contents screen">
<div class="cdata"><pre>
tree.php: 1.0K
findregex.php: 0.6K
findfile.php: 0.7K
dba_dump.php: 0.9K
nocvsdir.php: 1.1K
phar_from_dir.php: 1.0K
ini_groups.php: 0.9K
directorytree.php: 0.9K
dba_array.php: 1.1K
class_tree.php: 1.8K
</pre></div>
   </div>
  </div>
 </div>


</div></div></div></body></html>